/**
 * 
 */

package com.pp.admin.common.client;

import java.util.Date;

import com.google.gwt.user.client.Cookies;
import com.pp.admin.common.client.beans.LoginUserInfo;

/**
 * @author pandurang
 */
public class AdminCookies {
	
	public static final String	COOK_USER_ID	= "UID";
	
	public static void setUserCookie( LoginUserInfo user, String path, String domain, boolean secure ) {

		Date now = new Date();
		long nowLong = now.getTime();
		nowLong = nowLong + ( 1000 * 60 * 60 * 24 * 1 );//1 day
		now.setTime( nowLong );
		Cookies.setCookie( COOK_USER_ID, user.getUserID(), now, domain, path, secure );
	}
	
	public static void setCurrentDomainUserCookie( LoginUserInfo user ) {

		Cookies.setCookie( COOK_USER_ID, user.getUserID() );
	}
}
